package poker;

public class ObslugaWatkow
{
	public static void sprawdz(OstatniaKarta last_card, Karta cards[], Karta karty[])
	{
		synchronized (cards)
		{
			for (int i = last_card.wartosc(), j = 0; 
					j < 5 && i < last_card.max_liczba_kart_graczy(); ++i, ++j)
			{
				cards[i] = karty[j];
				last_card.dodaj_karty(1);
			}
			last_card.zakoncz_gre();
		}
	}
	
	public static void wyswietl_karty(Thread gracz, Karta karty[])
	{
		for (int i = 0; i < 5; ++i)
			System.out.println("Gracz: " + gracz.getName() + " Indeks: " + i
					+ " Wartosc: " + karty[i].pokaz_wartosc()
					+ " znak " + karty[i].pokaz_znak());
	}
}